Skip to content

fix(docker): detect GPU support via CDI for Podman runtimes#273

Merged
skevetter merged 3 commits into
mainfrom
2a7d-gpu-detection
May 13, 2026
Merged

fix(docker): detect GPU support via CDI for Podman runtimes#273
skevetter merged 3 commits into
mainfrom
2a7d-gpu-detection

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

GPU detection in DockerHelper.GPUSupportEnabled() previously relied on docker info -f '{{.Runtimes.nvidia}}', which is Docker-specific and fails under Podman since Podman does not expose runtimes the same way.

This change branches on IsPodman() to use runtime-appropriate detection: Docker continues checking for the nvidia container runtime, while Podman checks for nvidia CDI (Container Device Interface) devices via podman info -f '{{.Host.CDIDevices}}'. Both paths now gracefully fall back to "no GPU" with a debug log on command errors, instead of propagating failures to callers.

Includes 5 unit tests covering Docker ±nvidia, Podman ±CDI nvidia, and command failure fallback, plus an e2e test validating the detection path runs without crashing under the test environment's container runtime.

…ia runtime check

GPU detection previously used Docker-specific `info -f '{{.Runtimes.nvidia}}'`
which fails under Podman. Now branches on IsPodman() to check CDI devices
(`info -f '{{.Host.CDIDevices}}'`) for nvidia support. Both paths gracefully
fall back to no-GPU on command errors instead of propagating failures.
@netlify

netlify Bot commented May 13, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit bf8bca7
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a04c521fb9c9000083275f4

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@skevetter has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minute and 40 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 986051da-a202-4248-8fa0-ee88c73c576e

📥 Commits

Reviewing files that changed from the base of the PR and between 01ef390 and bf8bca7.

📒 Files selected for processing (6)
  • e2e/tests/up/gpu_detection.go
  • pkg/agent/delivery/factory.go
  • pkg/agent/delivery/kubernetes.go
  • pkg/agent/delivery/legacy_shell.go
  • pkg/docker/helper.go
  • pkg/docker/helper_test.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

skevetter added 2 commits May 13, 2026 13:35
Match the convention used by all other tests in e2e/tests/up/ so the
test is picked up by the CI label filter.
…ge constant

- Add //nolint:staticcheck on ExecFunc field declarations in factory.go,
  kubernetes.go, and legacy_shell.go (legacy bridge types require this type)
- Replace "docker" string literal in gpu_detection.go with testDockerCommand
  constant from the package to satisfy goconst
@skevetter
skevetter marked this pull request as ready for review May 13, 2026 18:38
@skevetter
skevetter enabled auto-merge (squash) May 13, 2026 18:38
@skevetter
skevetter merged commit 61d741d into main May 13, 2026
101 of 102 checks passed
@skevetter
skevetter deleted the 2a7d-gpu-detection branch May 13, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant